package com.fanx.base.execption;

import lombok.Data;

/**
 * @deprecated 自定义异常
 */
public class FanXPlusException extends RuntimeException{

    private String errMessage;

    public FanXPlusException() {
    }

    public FanXPlusException(String message) {
        super(message);
        this.errMessage = message;

    }

    public static void cast(String message){ throw new FanXPlusException(message); }

    public static void cast(CommonError error){
        throw new FanXPlusException(error.getErrMessage());
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }
}
